import axios from '@/utils/axios';

export const getCouponCodePage = (params) => {
    return axios.request({
        url: '/market/coupon/page',
        method: 'get',
        params
    });
};

export const getStringRandomCode = () => {
    return axios.request({
        url: '/market/coupon/get-random-code',
        method: 'get'
    });
};
export const addCouponCode = (data) => {
    return axios.request({
        url: '/market/coupon/',
        method: 'post',
        data
    });
};
export const editCouponCode = (data) => {
    return axios.request({
        url: '/market/coupon/',
        method: 'put',
        data
    });
};
export const getDataById = (id) => {
    return axios.request({
        url: '/market/coupon/' + id,
        method: 'get'
    });
};
export const activeCouponCode = (id) => {
    return axios.request({
        url: '/market/coupon/active/' + id,
        method: 'put'

    });
};
export const endCouponCode = (id) => {
    return axios.request({
        url: '/market/coupon/end/' + id,
        method: 'put'
    });
};
export const deleteCouponCode = (id) => {
    return axios.request({
        url: '/market/coupon/' + id,
        method: 'delete'
    });
};
export const getDataDetailById = (data) => {
    return axios.request({
        url: '/market/coupon/get-use-record',
        method: 'post',
        data
    });
};
